package com.sangfor.ssl.service.https;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/* loaded from: classes2.dex */
public class FileInfo {
    private static final String FILE_EXTRA_BODY = "file.extrabody";
    private static final String FILE_PART = "file.part";
    private static final String FILE_PATH = "file.pathname";
    private static final String FILE_TYPE = "file.type";
    private final Map<String, String> mMap;

    public FileInfo(File file, String str, String str2, String str3) {
        HashMap hashMap = new HashMap(3);
        this.mMap = hashMap;
        hashMap.put(FILE_PATH, file.getAbsolutePath());
        hashMap.put(FILE_EXTRA_BODY, str);
        hashMap.put(FILE_TYPE, str2);
        hashMap.put(FILE_PART, str3);
    }

    public FileInfo(File file, String str) {
        HashMap hashMap = new HashMap(3);
        this.mMap = hashMap;
        hashMap.put(FILE_PATH, file.getAbsolutePath());
        hashMap.put(FILE_EXTRA_BODY, str);
    }

    public FileInfo(File file) {
        HashMap hashMap = new HashMap(3);
        this.mMap = hashMap;
        hashMap.put(FILE_PATH, file.getAbsolutePath());
    }

    public FileInfo setBody(String str) {
        this.mMap.put(FILE_EXTRA_BODY, str);
        return this;
    }

    public FileInfo setMimeType(String str) {
        this.mMap.put(FILE_TYPE, str);
        return this;
    }

    public FileInfo setFileBoundary(String str) {
        this.mMap.put(FILE_PART, str);
        return this;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public String[][] toArrays() {
        String[] strArr = new String[this.mMap.size()];
        String[] strArr2 = new String[this.mMap.size()];
        int i = 0;
        for (Map.Entry<String, String> entry : this.mMap.entrySet()) {
            strArr[i] = entry.getKey();
            strArr2[i] = entry.getValue();
            if (strArr2[i] == null) {
                strArr2[i] = "";
            }
            i++;
        }
        return new String[][]{strArr, strArr2};
    }
}
